package org.androidpush.greendao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import org.androidpush.greendao.Schedule;
import org.androidpush.greendao.UserFriend;
import org.androidpush.greendao.CouSore;
import org.androidpush.greendao.ChatMsg;
import org.androidpush.greendao.Student;
import org.androidpush.greendao.NotificationMsg;
import org.androidpush.greendao.SelectCouInfo;

import org.androidpush.greendao.ScheduleDao;
import org.androidpush.greendao.UserFriendDao;
import org.androidpush.greendao.CouSoreDao;
import org.androidpush.greendao.ChatMsgDao;
import org.androidpush.greendao.StudentDao;
import org.androidpush.greendao.NotificationMsgDao;
import org.androidpush.greendao.SelectCouInfoDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig scheduleDaoConfig;
    private final DaoConfig userFriendDaoConfig;
    private final DaoConfig couSoreDaoConfig;
    private final DaoConfig chatMsgDaoConfig;
    private final DaoConfig studentDaoConfig;
    private final DaoConfig notificationMsgDaoConfig;
    private final DaoConfig selectCouInfoDaoConfig;

    private final ScheduleDao scheduleDao;
    private final UserFriendDao userFriendDao;
    private final CouSoreDao couSoreDao;
    private final ChatMsgDao chatMsgDao;
    private final StudentDao studentDao;
    private final NotificationMsgDao notificationMsgDao;
    private final SelectCouInfoDao selectCouInfoDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        scheduleDaoConfig = daoConfigMap.get(ScheduleDao.class).clone();
        scheduleDaoConfig.initIdentityScope(type);

        userFriendDaoConfig = daoConfigMap.get(UserFriendDao.class).clone();
        userFriendDaoConfig.initIdentityScope(type);

        couSoreDaoConfig = daoConfigMap.get(CouSoreDao.class).clone();
        couSoreDaoConfig.initIdentityScope(type);

        chatMsgDaoConfig = daoConfigMap.get(ChatMsgDao.class).clone();
        chatMsgDaoConfig.initIdentityScope(type);

        studentDaoConfig = daoConfigMap.get(StudentDao.class).clone();
        studentDaoConfig.initIdentityScope(type);

        notificationMsgDaoConfig = daoConfigMap.get(NotificationMsgDao.class).clone();
        notificationMsgDaoConfig.initIdentityScope(type);

        selectCouInfoDaoConfig = daoConfigMap.get(SelectCouInfoDao.class).clone();
        selectCouInfoDaoConfig.initIdentityScope(type);

        scheduleDao = new ScheduleDao(scheduleDaoConfig, this);
        userFriendDao = new UserFriendDao(userFriendDaoConfig, this);
        couSoreDao = new CouSoreDao(couSoreDaoConfig, this);
        chatMsgDao = new ChatMsgDao(chatMsgDaoConfig, this);
        studentDao = new StudentDao(studentDaoConfig, this);
        notificationMsgDao = new NotificationMsgDao(notificationMsgDaoConfig, this);
        selectCouInfoDao = new SelectCouInfoDao(selectCouInfoDaoConfig, this);

        registerDao(Schedule.class, scheduleDao);
        registerDao(UserFriend.class, userFriendDao);
        registerDao(CouSore.class, couSoreDao);
        registerDao(ChatMsg.class, chatMsgDao);
        registerDao(Student.class, studentDao);
        registerDao(NotificationMsg.class, notificationMsgDao);
        registerDao(SelectCouInfo.class, selectCouInfoDao);
    }
    
    public void clear() {
        scheduleDaoConfig.clearIdentityScope();
        userFriendDaoConfig.clearIdentityScope();
        couSoreDaoConfig.clearIdentityScope();
        chatMsgDaoConfig.clearIdentityScope();
        studentDaoConfig.clearIdentityScope();
        notificationMsgDaoConfig.clearIdentityScope();
        selectCouInfoDaoConfig.clearIdentityScope();
    }

    public ScheduleDao getScheduleDao() {
        return scheduleDao;
    }

    public UserFriendDao getUserFriendDao() {
        return userFriendDao;
    }

    public CouSoreDao getCouSoreDao() {
        return couSoreDao;
    }

    public ChatMsgDao getChatMsgDao() {
        return chatMsgDao;
    }

    public StudentDao getStudentDao() {
        return studentDao;
    }

    public NotificationMsgDao getNotificationMsgDao() {
        return notificationMsgDao;
    }

    public SelectCouInfoDao getSelectCouInfoDao() {
        return selectCouInfoDao;
    }

}
